// src/routes/backup.routes.js
const express = require('express');
const router = express.Router();
const backupController = require('../controllers/backupController');
const { verifyToken } = require('../middlewares/auth.middleware');

// 获取备份列表 - 需要身份验证
router.get('/getBackupList', verifyToken, backupController.getBackupList);

router.get('/restoreBackup', verifyToken, backupController.restoreBackupById);

// 保留原来的列表路由作为兼容
router.get('/list', verifyToken, backupController.getBackupList);

// 创建全量备份到自定义路径
router.post('/full/custom-path', verifyToken, backupController.createFullBackupToCustomPath);

// 创建增量备份到自定义路径
router.post('/incremental/custom-path', verifyToken, backupController.createIncrementalBackupToCustomPath);

// 从上传的备份文件还原数据
router.post('/restore/upload', verifyToken, backupController.restoreBackupFromUpload);

// 获取文件夹列表
router.get('/getFolderList', verifyToken, backupController.getFileList);

module.exports = router;